3.1085 \(\int \frac{a+i a \tan (e+f x)}{c+d \tan (e+f x)} \, dx\)

Optimal. Leaf size=45 \[ \frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)}+\frac{a x}{c-i d} \]

[Out]

(a*x)/(c - I*d) + (a*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((I*c + d)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0716694, antiderivative size = 45, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.077, Rules used = {3531, 3530} \[ \frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)}+\frac{a x}{c-i d} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])/(c + d*Tan[e + f*x]),x]

[Out]

(a*x)/(c - I*d) + (a*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((I*c + d)*f)

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{a+i a \tan (e+f x)}{c+d \tan (e+f x)} \, dx &=\frac{a x}{c-i d}+\frac{a \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{i c+d}\\ &=\frac{a x}{c-i d}+\frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{(i c+d) f}\\ \end{align*}

Mathematica [B]  time = 0.670089, size = 95, normalized size = 2.11 \[ \frac{-i a \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+2 a \tan ^{-1}\left (\frac{d \cos (2 e+f x)-c \sin (2 e+f x)}{c \cos (2 e+f x)+d \sin (2 e+f x)}\right )+4 a f x}{2 c f-2 i d f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])/(c + d*Tan[e + f*x]),x]

[Out]

(4*a*f*x + 2*a*ArcTan[(d*Cos[2*e + f*x] - c*Sin[2*e + f*x])/(c*Cos[2*e + f*x] + d*Sin[2*e + f*x])] - I*a*Log[(
c*Cos[e + f*x] + d*Sin[e + f*x])^2])/(2*c*f - (2*I)*d*f)

________________________________________________________________________________________

Maple [B]  time = 0.023, size = 157, normalized size = 3.5 \begin{align*}{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c}{f \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) d}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{ia\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{ia\ln \left ( c+d\tan \left ( fx+e \right ) \right ) c}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{a\ln \left ( c+d\tan \left ( fx+e \right ) \right ) d}{f \left ({c}^{2}+{d}^{2} \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

1/2*I/f*a/(c^2+d^2)*ln(1+tan(f*x+e)^2)*c-1/2/f*a/(c^2+d^2)*ln(1+tan(f*x+e)^2)*d+I/f*a/(c^2+d^2)*arctan(tan(f*x
+e))*d+1/f*a/(c^2+d^2)*arctan(tan(f*x+e))*c-I/f*a/(c^2+d^2)*ln(c+d*tan(f*x+e))*c+1/f*a/(c^2+d^2)*ln(c+d*tan(f*
x+e))*d

________________________________________________________________________________________

Maxima [B]  time = 1.5638, size = 122, normalized size = 2.71 \begin{align*} \frac{\frac{2 \,{\left (a c + i \, a d\right )}{\left (f x + e\right )}}{c^{2} + d^{2}} + \frac{2 \,{\left (-i \, a c + a d\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} + d^{2}} + \frac{{\left (i \, a c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*(a*c + I*a*d)*(f*x + e)/(c^2 + d^2) + 2*(-I*a*c + a*d)*log(d*tan(f*x + e) + c)/(c^2 + d^2) + (I*a*c - a
*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2))/f

________________________________________________________________________________________

Fricas [A]  time = 1.61768, size = 100, normalized size = 2.22 \begin{align*} \frac{a \log \left (\frac{{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{{\left (i \, c + d\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

a*log(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d))/((I*c + d)*f)

________________________________________________________________________________________

Sympy [B]  time = 2.79461, size = 94, normalized size = 2.09 \begin{align*} \frac{a \left (c^{3} - 3 i c^{2} d - 3 c d^{2} + i d^{3}\right ) \log{\left (\frac{c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{f \left (i c^{4} + 4 c^{3} d - 6 i c^{2} d^{2} - 4 c d^{3} + i d^{4}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

a*(c**3 - 3*I*c**2*d - 3*c*d**2 + I*d**3)*log((c + I*d)/(c*exp(2*I*e) - I*d*exp(2*I*e)) + exp(2*I*f*x))/(f*(I*
c**4 + 4*c**3*d - 6*I*c**2*d**2 - 4*c*d**3 + I*d**4))

________________________________________________________________________________________

Giac [A]  time = 1.416, size = 97, normalized size = 2.16 \begin{align*} -\frac{-\frac{2 i \, a \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}{c - i \, d} + \frac{i \, a \log \left ({\left | c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - c \right |}\right )}{c - i \, d}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

-(-2*I*a*log(tan(1/2*f*x + 1/2*e) + I)/(c - I*d) + I*a*log(abs(c*tan(1/2*f*x + 1/2*e)^2 - 2*d*tan(1/2*f*x + 1/
2*e) - c))/(c - I*d))/f